package com.jeesite.modules.ic.entity;

import javax.validation.constraints.Size;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 用户表Entity
 * @author 李寒冰
 * @version 2024-06-21
 */
@Table(name="ic_user", alias="a", label="用户表信息", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="mobile", attrName="mobile", label="手机号"),
		@Column(name="openid", attrName="openid", label="微信openid"),
		@Column(name="salt", attrName="salt", label="盐"),
		@Column(name="login_time", attrName="loginTime", label="最后登录时间"),
		@Column(name="create_time", attrName="createTime", label="注册时间"),
		@Column(name="update_time", attrName="updateTime", label="修改时间"),
		@Column(name="user_type", attrName="userType", label="用户类型 1主用户 2协作人"),
		@Column(name="status", attrName="status", label="status", isUpdate=false),
		@Column(name="token", attrName="token", label="用户登录token"),
		@Column(name="avatar_url", attrName="avatarUrl", label="头像"),
		@Column(name="nicheng", attrName="nicheng", label="昵称"),
		@Column(name="order_time", attrName="orderTime", label="最近下单时间"),
		@Column(name="order_day_num", attrName="orderDayNum", label="距上次下单间隔天数"),
		@Column(name="card_num", attrName="cardNum", label="卡数量"),
		@Column(name="company_id", attrName="companyId", label="公司ID"),
		@Column(name="unionid", attrName="unionid", label=""),
		@Column(name="wx_openid", attrName="wxOpenid", label="公众号OPENID"),
		@Column(name="juese", attrName="juese", label="1代理商  2普通客户 "),
		@Column(name="sum_income", attrName="sumIncome", label="总收益"),
		@Column(name="yester_income", attrName="yesterIncome", label="昨日收益"),
		@Column(name="sum_ticheng", attrName="sumTicheng", label="总提成"),
		@Column(name="yester_ticheng", attrName="yesterTicheng", label="昨日提成"),
		@Column(name="yue", attrName="yue", label="钱包余额"),
		@Column(name="platform_ratio", attrName="platformRatio", label="平台提成比例"),
		@Column(name="agent_ratio", attrName="agentRatio", label="代理商提成比例"),
		@Column(name="parent_user_id", attrName="parentUserId", label="代理商ID"),
		@Column(name="app_wx_openid", attrName="appWxOpenid", label="APP登录微信openID"),
		@Column(name="access_token", attrName="accessToken", label="AccessToken"),
		@Column(name="zhifubao_mobile", attrName="zhifubaoMobile", label="支付宝绑定的手机号"),
		@Column(name="shoukuan_name", attrName="shoukuanName", label="收款姓名"),
		@Column(name="max_ticheng", attrName="maxTicheng", label="最高提成"),
		@Column(name="platform_ratio_next", attrName="platformRatioNext", label="下级用户的平台抽成比例"),
		@Column(name="app_version", attrName="appVersion", label=""),
		@Column(name="is_meiti", attrName="isMeiti", label=""),
		@Column(name="meiti_user_code", attrName="meitiUserCode", label=""),
		@Column(name="jianzhibao_url", attrName="jianzhibaoUrl", label="兼职宝邀请链接"),
		@Column(name="jianzhi_url", attrName="jianzhiUrl", label="APP邀请链接"),
		@Column(name="app_device_type", attrName="appDeviceType", label="使用的设备类型 1安卓  2 H5"),
	}, orderBy="a.id DESC"
)
public class IcUser extends DataEntity<IcUser> {
	
	private static final long serialVersionUID = 1L;
	private String mobile;		// 手机号
	private String openid;		// 微信openid
	private String salt;		// 盐
	private Date loginTime;		// 最后登录时间
	private Date createTime;		// 注册时间
	private Date updateTime;		// 修改时间
	private String userType;		// 用户类型 1主用户 2协作人
	private String token;
	private String code;
	private String avatarUrl;
	private String nicheng;
	private Integer cardNum;
	private Integer orderDayNum;
	private Integer orderTime;
	private String companyId;
	private String unionid;
	private String wxOpenid;
	private Integer juese;
	private Double sumIncome;
	private Double yesterIncome;
	private Double sumTicheng;
	private Double yesterTicheng;
	private Double yue;
	private Double platformRatio;
	private Double agentRatio;
	private String parentUserId;
	private String appWxOpenid;
	private String accessToken;
	private String zhifubaoMobile;
	private String shoukuanName;
	private Double maxTicheng;
	private Double platformRatioNext;
	private String appVersion;
	private int weidenglvDay;
	private String isMeiti;
	private String meitiUserCode;
	private String jianzhibaoUrl;
	private String jianzhiUrl;
	private String appDeviceType;

	public String getAppDeviceType() {
		return appDeviceType;
	}

	public void setAppDeviceType(String appDeviceType) {
		this.appDeviceType = appDeviceType;
	}

	public String getJianzhibaoUrl() {
		return jianzhibaoUrl;
	}

	public void setJianzhibaoUrl(String jianzhibaoUrl) {
		this.jianzhibaoUrl = jianzhibaoUrl;
	}

	public String getJianzhiUrl() {
		return jianzhiUrl;
	}

	public void setJianzhiUrl(String jianzhiUrl) {
		this.jianzhiUrl = jianzhiUrl;
	}

	public String getMeitiUserCode() {
		return meitiUserCode;
	}

	public void setMeitiUserCode(String meitiUserCode) {
		this.meitiUserCode = meitiUserCode;
	}
	public String getIsMeiti() {
		return isMeiti;
	}

	public void setIsMeiti(String isMeiti) {
		this.isMeiti = isMeiti;
	}

	public int getWeidenglvDay() {
		return weidenglvDay;
	}

	public void setWeidenglvDay(int weidenglvDay) {
		this.weidenglvDay = weidenglvDay;
	}

	public String getAppVersion() {
		return appVersion;
	}

	public void setAppVersion(String appVersion) {
		this.appVersion = appVersion;
	}

	//分销设备数
	private int fenxiaoDevice;

	//扩展字段
	//下级用户人数
	private int xiajiNum;

	public int getFenxiaoDevice() {
		return fenxiaoDevice;
	}

	public void setFenxiaoDevice(int fenxiaoDevice) {
		this.fenxiaoDevice = fenxiaoDevice;
	}

	public Double getPlatformRatioNext() {
		return platformRatioNext;
	}

	public void setPlatformRatioNext(Double platformRatioNext) {
		this.platformRatioNext = platformRatioNext;
	}

	public int getXiajiNum() {
		return xiajiNum;
	}

	public void setXiajiNum(int xiajiNum) {
		this.xiajiNum = xiajiNum;
	}

	public Double getMaxTicheng() {
		return maxTicheng;
	}

	public void setMaxTicheng(Double maxTicheng) {
		this.maxTicheng = maxTicheng;
	}
	/**扩展字段*/
	private Integer isGuanzhuan;
	private IcUser parentUser;

	public void setParentUser(IcUser parentUser) {
		this.parentUser = parentUser;
	}

	public IcUser getParentUser() {
		return parentUser;
	}

	public Integer getIsGuanzhuan() {
		return isGuanzhuan;
	}

	public void setIsGuanzhuan(Integer isGuanzhuan) {
		this.isGuanzhuan = isGuanzhuan;
	}

	public String getShoukuanName() {
		return shoukuanName;
	}

	public void setShoukuanName(String shoukuanName) {
		this.shoukuanName = shoukuanName;
	}

	public String getZhifubaoMobile() {
		return zhifubaoMobile;
	}

	public void setZhifubaoMobile(String zhifubaoMobile) {
		this.zhifubaoMobile = zhifubaoMobile;
	}

	public String getAccessToken() {
		return accessToken;
	}

	public void setAccessToken(String accessToken) {
		this.accessToken = accessToken;
	}

	//扩展字段
	private Integer yaoqingRenNum;
	private int deviceNum;

	public String getAppWxOpenid() {
		return appWxOpenid;
	}

	public void setAppWxOpenid(String appWxOpenid) {
		this.appWxOpenid = appWxOpenid;
	}

	public int getDeviceNum() {
		return deviceNum;
	}

	public void setDeviceNum(int deviceNum) {
		this.deviceNum = deviceNum;
	}

	public Integer getYaoqingRenNum() {
		return yaoqingRenNum;
	}

	public void setYaoqingRenNum(Integer yaoqingRenNum) {
		this.yaoqingRenNum = yaoqingRenNum;
	}

	public String getParentUserId() {
		return parentUserId;
	}

	public void setParentUserId(String parentUserId) {
		this.parentUserId = parentUserId;
	}

	public Double getPlatformRatio() {
		return platformRatio;
	}

	public void setPlatformRatio(Double platformRatio) {
		this.platformRatio = platformRatio;
	}

	public Double getAgentRatio() {
		return agentRatio;
	}

	public void setAgentRatio(Double agentRatio) {
		this.agentRatio = agentRatio;
	}

	public Double getSumIncome() {
		return sumIncome;
	}

	public void setSumIncome(Double sumIncome) {
		this.sumIncome = sumIncome;
	}

	public Double getYesterIncome() {
		return yesterIncome;
	}

	public void setYesterIncome(Double yesterIncome) {
		this.yesterIncome = yesterIncome;
	}

	public Double getSumTicheng() {
		return sumTicheng;
	}

	public void setSumTicheng(Double sumTicheng) {
		this.sumTicheng = sumTicheng;
	}

	public Double getYesterTicheng() {
		return yesterTicheng;
	}

	public void setYesterTicheng(Double yesterTicheng) {
		this.yesterTicheng = yesterTicheng;
	}

	public Double getYue() {
		return yue;
	}

	public void setYue(Double yue) {
		this.yue = yue;
	}

	public Integer getJuese() {
		return juese;
	}

	public void setJuese(Integer juese) {
		this.juese = juese;
	}

	//联查字段
	private String companyName;


	public String getUnionid() {
		return unionid;
	}

	public void setUnionid(String unionid) {
		this.unionid = unionid;
	}

	public String getWxOpenid() {
		return wxOpenid;
	}

	public void setWxOpenid(String wxOpenid) {
		this.wxOpenid = wxOpenid;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public String getCompanyId() {
		return companyId;
	}

	public void setCompanyId(String companyId) {
		this.companyId = companyId;
	}

	public Integer getCardNum() {
		return cardNum;
	}

	public void setCardNum(Integer cardNum) {
		this.cardNum = cardNum;
	}

	public Integer getOrderDayNum() {
		return orderDayNum;
	}

	public void setOrderDayNum(Integer orderDayNum) {
		this.orderDayNum = orderDayNum;
	}

	public Integer getOrderTime() {
		return orderTime;
	}

	public void setOrderTime(Integer orderTime) {
		this.orderTime = orderTime;
	}

	public String getNicheng() {
		return nicheng;
	}

	public void setNicheng(String nicheng) {
		this.nicheng = nicheng;
	}

	public String getAvatarUrl() {
		return avatarUrl;
	}

	public void setAvatarUrl(String avatarUrl) {
		this.avatarUrl = avatarUrl;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public IcUser() {
		this(null);
	}
	
	public IcUser(String id){
		super(id);
	}
	
	@Size(min=0, max=255, message="手机号长度不能超过 255 个字符")
	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	
	@Size(min=0, max=255, message="微信openid长度不能超过 255 个字符")
	public String getOpenid() {
		return openid;
	}

	public void setOpenid(String openid) {
		this.openid = openid;
	}
	
	@Size(min=0, max=255, message="盐长度不能超过 255 个字符")
	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd")
	public Date getLoginTime() {
		return loginTime;
	}

	public void setLoginTime(Date loginTime) {
		this.loginTime = loginTime;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd")
	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	
	@Size(min=0, max=255, message="用户类型 1主用户 2协作人长度不能超过 255 个字符")
	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	public void setLoginTimeGt(Date time){
		this.sqlMap.getWhere().and("login_time",QueryType.GT,time);
	}
	
}